package cn.tx.redis7.controller;

import cn.tx.redis7.service.HyperLogLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author：codeJ
 * @Create：2025/6/2
 */
@Api(tags = "淘宝亿级UV的Redis统计方案")
@RestController
@Slf4j
public class HyperLogLogController {

    @Resource
    private HyperLogLogService hyperLogLogService;

    @Resource
    private RedisTemplate redisTemplate;

    @ApiOperation("获取IP去重复后的UV统计访问量")
    @GetMapping("/uv")
    public long uv(){
        return hyperLogLogService.uv();
    }

}
